# -*- coding: utf-8 -*-
"""
Created on Fri Apr 26 12:58:54 2019

@author: yaoyu
"""

import jieba
import wordcloud

fname = '新时代中国特色社会主义.txt'
fname = '关于实施乡村振兴战略的意见.txt'
f = open(fname,'r',encoding='utf8')
t = f.read()
f.close()
ls = jieba.lcut(t)
txt = ' '.join(ls)
w = wordcloud.WordCloud(font_path='msyh.ttc',
                        width=1000,
                        height=700,
                        background_color='white',
                        max_words=15)
w.generate(txt)
w.to_file('gr.png')